exports.add=[{
	 _type:"model_methods",
	_config: {name:"User"},
	
	CalcCustom: function() {
		if (this.first_name) {
			this.calc_full_name=this.first_name;
			if (this.last_name) this.calc_full_name+=" "+this.last_name;
		} else if (this.last_name) {
			this.calc_full_name=this.last_name;
		}
		var rr=this.GetRR();
		var cnt_ue=rr.site.models.UserEnrolled.Count("count_of_user",{user_id:this.id});
		this.calc_no_roles=cnt_ue?0:1;
	},

	StopSession: function() {
		var rr=this.GetRR();
		rr.auth_engine.logoff(rr);
		rr.uid=0;
		rr.user={};
	},

	StartSession: function() {
		var rr=this.GetRR();
		rr.auth_engine.force_auth(rr,this.id);
	}
}];

